package com.jielihaofeng.springboot.shorturl.util;

import java.util.Base64;

/**
 * @author Johnnie Wind
 * @description 短链工具类
 * @date 2021/6/3 14:16
 */
public class ShortUrlUtil {

    public static String nextOne(){
        long snowFlakeId = new SnowFlake(1, 1).nextId();
        return NumericConvertUtils.toBase62(snowFlakeId);
    }

    public static void main(String[] args) {
        String s = NumericConvertUtils.toBase62(201314L);
        System.err.println(s);

        long l1 = new SnowFlake(1, 1).nextId();
        long l2 = new SnowFlake(1, 2).nextId();
        long l3 = new SnowFlake(2, 1).nextId();
        System.out.println(l1);
        System.out.println(l2);
        System.out.println(l3);
        System.out.println(NumericConvertUtils.toBase62(l1));
        System.out.println(NumericConvertUtils.toBase62(l2));
        System.out.println(NumericConvertUtils.toBase62(l3));
    }

}
